package com.snail.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.snail.model.pojo.mall.BizProduct;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BizProductMapper extends BaseMapper<BizProduct> {
    // 可以在此添加自定义SQL方法

    //根据id查询商品
    @Select("SELECT * FROM biz_product WHERE product_id = #{productId}")
    BizProduct selectById(Integer productId);

    // 连表查询商品及关联规格
    List<BizProduct> selectProductWithSpecs(Integer productId);
}